<template>
	<div class="paginationBox">
		<el-pagination
			v-model:current-page="currentNum"
			:page-size="props.pageSize"
			background
			layout="total, prev, pager, next"
			:total="props.total"
			@current-change="handleCurrentChange"
		/>
	</div>
</template>
<script setup lang="ts">
import { ref } from 'vue';
interface Props {
	total?: number | string;
	current?: number | string;
	pageSize?: number | string;
}
const props: Props = withDefaults(defineProps<Props>(), {
	pageSize: 10,
	total: 0,
	current: 1,
});
const currentNum = ref(props.current);
const emit = defineEmits(['paginaClick']);
const handleCurrentChange = (v: number) => {
	emit('paginaClick', v);
};
</script>
